<?php
include("class.php");

$rpc=new JSRPC();

$rpc->registerMethod('pokus','a,b');
$rpc->registerMethod('pokus2','pocet,text');
//echo $rpc->toJS();



$test=new JS();

$test->alert('ahoj');

$test->getElementById('label')->innerHTML='ahoj';
$test->alert('Vysledek je 20..30');

$test->getElementById('label')->innerHTML='txt';

//echo serialize($test);

$out="abc123/*-def";

$out=preg_replace('/\W/i','',$out);
echo $out;

/*
$test='[\"Saab\",\"Volvo\",\"BMW\"]';
print_r(json_decode(stripslashes($test)));
*/
?>

<div id="label">LABEL</div>


<script src="http://test/jsrpc/rpc.php?js=1"></script>

<script>
/*
var x=PHP_soucet(3,5)+PHP_soucet(3,5);
alert('Prvni:'+x);

PHP_rozdil(10,2);
PHP_opakuj("ahoj'"+' "vole" ',3);

alert(PHP_soucet(3,5));
*/


PHP_pokus(1,2);

var mycars = new Array()
mycars[0] = "Saab"
mycars[1] = "Volvo"
mycars[2] = "BMW"

alert(PHP_arr(mycars));

var mycars = PHP_json();
/*
var mycars = new Array()
mycars[0] = "Saab"
mycars[1] = "Volvo"
mycars[2] = "BMW"
*/
for (i=0;i<mycars.length;i++)
{
document.write(mycars[i] + "<br />")
}
</script>